package com.nick.proxy.custom;

import java.lang.reflect.Method;

/**
 * Created by xiaobao on 2017/7/9.
 */
public class CustomTranslator implements CustomInvocationHandler {
        private Object target;

        public CustomTranslator(Object target) {
            this.target = target;
        }
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            System.out.println("CustomProxy Translator start translating...");
            Object object = method.invoke(target, args);
            System.out.println("你好，我是尼克，来自中国。");
            System.out.println("CustomProxy Translator finished translating.");
            return object;
        }
}
